package com.pm.project.mapper;

import com.alibaba.fastjson2.JSONObject;
import com.github.yulichang.base.MPJBaseMapper;
import com.pm.buglist.domain.SysFiles;
import com.pm.common.core.domain.entity.ProjectTempleteDefine;
import com.pm.project.domain.ProjectList;
import com.pm.project.domain.ProjectListNode;
import com.pm.project.domain.ProjectModifyRecord;
import com.pm.project.domain.ProjectModifyRecordDetail;
import com.pm.project.domain.vo.ProjectListNodeMemberVO;
import com.pm.project.domain.vo.ProjectListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProjectListNodeMapper extends MPJBaseMapper<ProjectListNode> {


    List<ProjectTempleteDefine> getProjectNodes(@Param("projectListId") Long projectListId,@Param("userId") Long userId);

    void addProjectNodes(JSONObject param);

    void addProjectNodeMembers(JSONObject item);

    List<ProjectListNodeMemberVO> queryTaskListByUserId(ProjectListVO projectListVO);

    void addProjectNodeMilestone(JSONObject item);

    ProjectListVO queryProjectInfo(@Param("projectNodeMemberId") String projectNodeMemberId);

    ProjectListVO queryProjectInfoByOaId(@Param("oaId") String oaId);

    void updateNodeMember(JSONObject update);

    void projectFileProcessBackStatus(JSONObject jsonObject);


    ProjectListNodeMemberVO queryProjectTaskInfo(JSONObject param);

    List<JSONObject> queryTaskFile(@Param("projectNodeMemberId") Long projectNodeMemberId);

    void addFileMember(JSONObject param);

    void calculateTaskOverdue();

    void calculateProjectOverdue(JSONObject obj);

    JSONObject totalTaskForUser(JSONObject obj);

    JSONObject totalProjectForUser(JSONObject param);

    JSONObject queryOATempleteId(@Param("projectNodeMemberId") String projectNodeMemberId);

    List<JSONObject> queryApproveList(JSONObject res);

    List<ProjectModifyRecordDetail> queryProjectModifyRecordForDetail(ProjectModifyRecord projectModifyRecord);

    void updateMemberTime(ProjectModifyRecordDetail detail);

    void updateChildrenMemberTime(JSONObject param);

    List<Long> queryUpdatePnIds(ProjectListNode projectListNode);

    int queryUnDoneNum(@Param("projectListId")Long projectListId);

    JSONObject queryProjectIdByOaId(@Param("oaId")String oaId);

    JSONObject queryProjectListNodeMember(JSONObject param);

    List<JSONObject> getMyProjectFile(ProjectListVO projectListVO);

    List<JSONObject> queryOverDueProjectList();

    List<ProjectListNodeMemberVO> exportByProjectId(ProjectListVO projectListVO);

    void addProjectNodeMembersDraft(JSONObject obj);

    void addProjectNodeMembersTimeDraft(ProjectListNode projectListNode);

    List<ProjectTempleteDefine> getProjectNodesDraft(@Param("projectListId") Long projectListId,@Param("userId") Long userId);

    void deleteDraft(@Param("projectListId")Long id);

    List<Integer> getSetup(@Param("projectListId")Long projectListId);

    void delFilePLM(JSONObject param);

    void  initProjectOverdue();


    List<JSONObject> hasChildrenNode(ProjectListNode projectListNodeRes);

    void delParentNode(ProjectListNode projectListNodeRes);
}
